<template>
	<view class="content">
		<view class="top">
			<uv-tabs :list="tabList" :current="current" lineColor="#1DB481" :inactiveStyle="{color:'#333333'}"
				:activeStyle="{color:'#333333'}" @click="tabsClick" :scrollable="false"></uv-tabs>
		</view>
		<view class="header">
			<view class="tabs">
				<view class="item font28" :class="tabsIndex == index?'bg':''" v-for="(item,index) in tabsList"
					@click="tabs(index)">
					{{item.name}}
				</view>
			</view>

		</view>
		<view class="box">
			<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltolower="scrolltolower">
				<view class="timeBox">
					<view class="starTime font28">
						{{starTime}}
					</view>
					<view class="heng">
						-
					</view>
					<view class="endTime font28">
						{{endTime}}
					</view>
				</view>
				<view class="item" v-for="(item,index) in profitList" :key="index">
					<view class="left" style="margin-bottom: 24rpx;">
						<view class="title font28">
							{{item.title}}
						</view>
						<view class="t_price">
							<view class="type font24">
								{{item.type}}
							</view>
							<view class="icon">


								<image src="../../../static/images/shopowner/1.png" mode="aspectFit"></image>


								<image src="../../../static/images/shopowner/1.png" mode="aspectFit"></image>

								<image src="/shareholder/static/images/1.png" mode="aspectFit"></image>



								<image src="/shareholder/static/images/1.png" mode="aspectFit"></image>

							</view>
						</view>
					</view>
					<view class="left">
						<view class="title font28">
							会员消费提成<text class="font30" style="color: #FF6600;">￥{{item.ticheng}}</text>
						</view>
						<view class="t_price">
							<view class="price font30 fontw">
								1次/￥{{item.price}}
							</view>
							<view class="icon">


								<image src="../../../static/images/shopowner/1.png" mode="aspectFit"></image>


								<image src="../../../static/images/shopowner/1.png" mode="aspectFit"></image>

								<image src="/shareholder/static/images/1.png" mode="aspectFit"></image>



								<image src="/shareholder/static/images/1.png" mode="aspectFit"></image>

							</view>
						</view>
					</view>
				</view>
			</scroll-view>
		</view>
		<yt-dateTimePicker ref="starShow" @submit="starTimes" :start-year="2000" :end-year="2099" time-init="2023-5-20"
			:time-hide="[true, true, true, true, true, true]" :time-label="['年', '月', '日', '时', '分', '秒']" />
		<yt-dateTimePicker ref="endShow" @submit="endTimes" :start-year="2000" :end-year="2099" time-init="2023-5-20"
			:time-hide="[true, true, true, true, true, true]" :time-label="['年', '月', '日', '时', '分', '秒']" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current: 0,
				tabList: [{
					name: '保养提成'
				}, {
					name: '充值提成'
				}, {
					name: '会员提成'
				}],
				tabsList: [
					{ name: '今日' },
					{ name: '昨日' },
					{ name: '本月' },
					{ name: '上月' }
				],
				scrollTop: 0,
				tabsIndex: 0,
				starTime: '', //开始时间
				endTime: '', // 结束时间
				profitList: [{
					title: '财务张 18596579654',
					type: '中式按摩',
					className: '营收金额',
					price: '950',
					ticheng: '100'
				}, {
					title: '财务张 18596579654',
					type: '中式按摩',
					className: '营收金额',
					price: '950',
					ticheng: '100'
				}, {
					title: '财务张 18596579654',
					type: '中式按摩',
					className: '营收金额',
					price: '950',
					ticheng: '100'
				}, {
					title: '财务张 18596579654',
					type: '中式按摩',
					className: '营收金额',
					price: '950',
					ticheng: '100'
				}, {
					title: '财务张 18596579654',
					type: '中式按摩',
					className: '营收金额',
					price: '950',
					ticheng: '100'
				}]
			};
		},
		onLoad() {
			this.getCurrentTime()
		},
		methods: {
			getCurrentTime() {
				const now = new Date();
				const year = now.getFullYear();
				const month = String(now.getMonth() + 1).padStart(2, '0');
				const day = String(now.getDate()).padStart(2, '0');
				const hours = String(now.getHours()).padStart(2, '0');
				const minutes = String(now.getMinutes()).padStart(2, '0');
				const seconds = String(now.getSeconds()).padStart(2, '0');
				this.starTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
				this.endTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
			},
			tabs(index) {
				this.tabsIndex = index
			},
			starOpen() {
				this.$refs.starShow.show();
			},
			endOpen() {
				this.$refs.endShow.show();
			},
			starClose() {
				this.$refs.starShow.hide();
			},
			endClose() {
				this.$refs.endShow.hide();
			},
			// 开始时间
			starTimes(e) {
				this.starTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
			},
			// 结束时间
			endTimes(e) {
				this.endTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
			},
			tabsClick(e) {
				this.current = e.index
			},
			scrolltolower() {}
		}
	}
</script>

<style lang="scss">
	.content {
		.top {
			margin-bottom: 30rpx;
		}

		.header {
			padding: 0 33rpx;
			margin-bottom: 16rpx;

			.tabs {
				background: #E6F9EF;
				border-radius: 60rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;

				.bg {
					background: #1EB481;
					border-radius: 60rpx;
					color: #fff !important;
				}

				.item {
					width: 25%;
					color: #1EB481;
					text-align: center;
					padding: 20rpx 0;
					transition: 0.3s linear;
				}
			}
		}

		.box {
			padding: 0 33rpx;

			.scroll-Y {
				height: calc(100vh - 184rpx - 58rpx - 24rpx);

				.timeBox {
					display: flex;
					justify-content: space-between;
					align-items: center;
					padding: 32rpx 21rpx;
					background-color: #fff;
					margin-top: 18rpx;

					.starTime {
						color: #333333;
					}

					.heng {}

					.endTime {
						color: #333333;
					}
				}

				.item {

					.left {
						display: flex;
						justify-content: space-between;
						align-items: center;
						padding: 47rpx 30rpx 47rpx 20rpx;
						margin-bottom: 18rpx;
						background-color: #fff;

						.title {}

						.t_price {
							display: flex;
							align-items: center;

							.type {
								padding: 7rpx 14rpx;
								background: #F2FDF8;
								border-radius: 50rpx;
								border: 1px solid #7EDBAA;
								color: #07C160;
								margin-right: 8rpx;
							}

							.des {
								color: #333333;
							}

							.price {
								margin: 0 20rpx;
							}

							.icon {
								width: 13rpx;
								height: 24rpx;
								display: flex;

								image {
									width: 13rpx;
									height: 24rpx;
								}
							}
						}

					}
				}
			}
		}
	}
</style>